<?php $__env->startSection('content'); ?>

    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">助理</strong> /
                    <small>List</small>
                </div>
            </div>
            <?php echo $__env->make('admin._flash', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="/admin/helper/create" type="button" class="am-btn am-btn-default"><span
                                        class="am-icon-plus"></span> 新增</a>
                            <button type="button" class="am-btn am-btn-default select_del"><span
                                        class="am-icon-trash-o"></span> 删除
                            </button>
                        </div>
                    </div>
                </div>


            </div>

            <div class="am-g"  >
                <div class="am-u-sm-12 am-u-md-12">
                    <form class="am-form-inline" method="get">
                        <div class="am-form-group">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" name="name"
                                       placeholder="按名字搜索"    value="<?php echo e(Request::input('name')); ?>">
                            </div>
                        </div>
                        <div class="am-form-group" style="margin-top: 3px">
                            <button type="submit" class="am-btn am-btn-default am-btn-sm">查询</button>
                            <a href="/admin/helper" class="am-btn am-btn-default am-btn-sm">重置</a>
                        </div>
                    </form>
                </div>
            </div>

            <hr>



            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr style="font-size: 1.6rem">
                                <th><input class="check_all" type="checkbox"></th>
                                <th class="table-id">ID</th>
                                <th class="table-type">姓名</th>
                                <th class="table-type">编号</th>
                                <th class="table-author" style="width:70px;">电话号码</th>
                                <th class="table-author" style="width:70px;">提成</th>

                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $helpers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=> $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr data-id="" style="font-size: 1.6rem">
                                <th><input class="checked_id" name="checked_id[]" value="<?php echo e($c->id); ?>" type="checkbox"></th>
                                <td><?php echo e($k+1); ?></td>
                                <td><?php echo e($c->name); ?></td>
                                <td>
                                    <label class="am-btn am-btn-secondary am-btn-xs am-radius" >
                                        <?php echo e($c->number); ?>

                                    </label>

                                </td>
                                <td>
                                    <label class="am-btn am-btn-danger am-btn-xs am-radius" >
                                        <?php echo e($c->tel); ?>

                                    </label>

                                </td>

                                <td><?php echo e($c->percentage); ?>元</td>




                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <a href="/admin/helper/<?php echo e($c->id); ?>/edit" class="am-btn am-btn-primary am-btn-xs"><span
                                                        class="am-icon-pencil-square-o"></span> 编辑
                                            </a>
                                            <a href="/admin/helper/<?php echo e($c->id); ?>"
                                               data-method="delete"
                                               data-token="<?php echo e(csrf_token()); ?>" data-confirm="确认删除吗?"
                                               class="am-btn am-btn-danger am-btn-xs del_one">
                                                <span class="am-icon-trash-o"></span> 删除
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                            </tbody>
                        </table>
                        共 <?php echo e($helpers->total()); ?> 条记录

                        <div class="am-cf">
                            <div class="am-fr">
                                <?php echo $helpers->appends(Request::all())->links(); ?>

                            </div>
                        </div>
                        <hr/>
                        <p>注：.....</p>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script>
        $(function () {

            //全选按钮
            $('.check_all').click(function () {
                var checked = $(this).prop('checked');
                $('.checked_id').prop('checked',checked);
            })




            //多选删除
            $('.select_del').click(function () {
                var length = $('.checked_id:checked').length;
                if(length == 0){
                    alert("请至少选取一条记录");
                    return false;
                }

                if(confirm("您确定要删除吗？")){

                    var checked_id = $('.checked_id:checked').serialize();
//                    console.log(check_id);return false;

                    $.ajax({
                        type:'DELETE',
                        url:'/admin/helper/delete_all',
                        data:checked_id,
                        success: function () {
                            location.href = location.href;
                        }
                    })
                }
                return false;
            })




        })
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.application', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>